#! /bin/bash
HIVE_HOME=/usr/bin/hive


${HIVE_HOME} -S -e "

create table zx_dwb.dwb_sign_detail
(
       course_id             int,
       base_id               int,
       course_class_id       int,
       class_date            string,
       content               string,
       teacher_id            int,
       teacher_name          string,
       job_number            string,
       classroom_id          int,
       classroom_name        string,
       is_outline            int,
       class_mode            int,
       is_stage_exam         int,
       is_pay                int,
       tutor_teacher_id      int,
       tutor_teacher_name    string,
       tutor_job_number      string,
       is_subsidy            int,
       answer_teacher_id     int,
       answer_teacher_name   string,
       answer_job_number     string,
       course_remark         string,
       course_create_time    string,

       signin_id             int,
       normal_class_flag     int,
       time_table_id         int,
       signin_class_id       int,
       student_id            int,
       signin_time           string,
       signin_date           string,
       inner_flag            int,
       signin_type           int,
       share_state           int,
       inner_ip              string,

       time_id               int,
       time_class_id         int,
       morning_template_id   int,
       morning_begin_time    string,
       morning_end_time      string,
       afternoon_template_id int,
       afternoon_begin_time  string,
       afternoon_end_time    string,
       evening_template_id   int,
       evening_begin_time    string,
       evening_end_time      string,
       use_begin_date        string,
       use_end_date          string,
       time_create_time      string,
       create_person         int,
       time_remark           string
)
partitioned by (dt string)
row format delimited
fields terminated by '/t'
stored as orc
tblproperties ('orc.compress'='SNAPPY');


create table zx_dwb.dwb_leave_detail
(
       course_id                                int,
       base_id                                  int,
       course_class_id                          int,
       class_date                               string,
       content                                  string,
       teacher_id                               int,
       teacher_name                             string,
       job_number                               string,
       classroom_id                             int,
       classroom_name                           string,
       is_outline                               int,
       class_mode                               int,
       is_stage_exam                            int,
       is_pay                                   int,
       tutor_teacher_id                         int,
       tutor_teacher_name                       string,
       tutor_job_number                         string,
       is_subsidy                               int,
       answer_teacher_id                        int,
       answer_teacher_name                      string,
       answer_job_number                        string,
       course_remark                            string,
       course_create_time                       string,

       leave_id                                 int,
       leave_class_id                           int,
       student_id                               int,
       audit_state                              int,
       audit_person                             int,
       audit_time                               string,
       audit_remark                             string,
       leave_type                               int,
       leave_reason                             int,
       begin_time                               string,
       begin_time_type                          int,
       end_time                                 string,
       end_time_type                            int,
       days                                     string,
       cancel_state                             int,
       cancel_time                              string,
       old_leave_id                             int,
       leave_remark                             string,
       valid_state                              int,
       leave_create_time                        string,

       time_id                                  int,
       time_class_id                            int,
       morning_template_id                      int,
       morning_begin_time                       string,
       morning_end_time                         string,
       afternoon_template_id                    int,
       afternoon_begin_time                     string,
       afternoon_end_time                       string,
       evening_template_id                      int,
       evening_begin_time                       string,
       evening_end_time                         string,
       use_begin_date                           string,
       use_end_date                             string,
       time_create_time                         string,
       create_person                            int,
       time_remark                              string
)
partitioned by (dt string)
row format delimited
fields terminated by '/t'
stored as orc
tblproperties ('orc.compress'='SNAPPY');